<?php
namespace Common\Models;
use Common\BaseModel;
class WithdrawalsLog extends BaseModel
{
    public $res;
    public $key;
    public function initialize()
    {
        parent::initialize();
        $this->setSource('f_withdrawals_log');
    }

    /**
     * 获取具体的内容
     * @param int $cid 栏目id
     * @param int $cateid 分类id
     * @param int $is_recommend 是否首页推荐
     * @return mixed
     */
    public function find_count($user_id){
        $start_time=date('Y-m-d',time())."  00:00:00";
        $end_time=date('Y-m-d',time())."  23:59:59";
        $conditions="user_id={$user_id} AND created_at >= '{$start_time}' AND created_at <= '{$end_time}'";
        $user_count = $this::count(
            array(
                $conditions,
                "columns"=>"id",
            )
        );
        return $user_count;
    }


    public function save_withdrawlog($params){
        $result = $this::save($params);
        if($result){
            return true;
        }else{
            return false;
        }
    }





}
